package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bestow.basic.mapper.HlsDbDataSourceColumnMapper;
import com.bestow.basic.domain.HlsDbDataSourceColumn;
import com.bestow.basic.service.IHlsDbDataSourceColumnService;

/**
 * 数据来源字段Service业务层处理
 * 
 * @author liliu
 * @date 2022-12-10
 */
@Service
public class HlsDbDataSourceColumnServiceImpl extends ServiceImpl<HlsDbDataSourceColumnMapper, HlsDbDataSourceColumn> implements IHlsDbDataSourceColumnService
{
    @Autowired
    private HlsDbDataSourceColumnMapper hlsDbDataSourceColumnMapper;

    /**
     * 查询数据来源字段
     * 
     * @param dataSourceColumnId 数据来源字段主键
     * @return 数据来源字段
     */
    @Override
    public HlsDbDataSourceColumn selectHlsDbDataSourceColumnByDataSourceColumnId(Long dataSourceColumnId)
    {
        return hlsDbDataSourceColumnMapper.selectHlsDbDataSourceColumnByDataSourceColumnId(dataSourceColumnId);
    }

    /**
     * 查询数据来源字段列表
     * 
     * @param hlsDbDataSourceColumn 数据来源字段
     * @return 数据来源字段
     */
    @Override
    public List<HlsDbDataSourceColumn> selectHlsDbDataSourceColumnList(HlsDbDataSourceColumn hlsDbDataSourceColumn)
    {
        return hlsDbDataSourceColumnMapper.selectHlsDbDataSourceColumnList(hlsDbDataSourceColumn);
    }

    /**
     * 新增数据来源字段
     * 
     * @param hlsDbDataSourceColumn 数据来源字段
     * @return 结果
     */
    @Override
    public int insertHlsDbDataSourceColumn(HlsDbDataSourceColumn hlsDbDataSourceColumn)
    {
        hlsDbDataSourceColumn.setCreateTime(DateUtils.getNowDate());
        return hlsDbDataSourceColumnMapper.insertHlsDbDataSourceColumn(hlsDbDataSourceColumn);
    }

    /**
     * 修改数据来源字段
     * 
     * @param hlsDbDataSourceColumn 数据来源字段
     * @return 结果
     */
    @Override
    public int updateHlsDbDataSourceColumn(HlsDbDataSourceColumn hlsDbDataSourceColumn)
    {
        hlsDbDataSourceColumn.setUpdateTime(DateUtils.getNowDate());
        return hlsDbDataSourceColumnMapper.updateHlsDbDataSourceColumn(hlsDbDataSourceColumn);
    }

    /**
     * 批量删除数据来源字段
     * 
     * @param dataSourceColumnIds 需要删除的数据来源字段主键
     * @return 结果
     */
    @Override
    public int deleteHlsDbDataSourceColumnByDataSourceColumnIds(Long[] dataSourceColumnIds)
    {
        return hlsDbDataSourceColumnMapper.deleteHlsDbDataSourceColumnByDataSourceColumnIds(dataSourceColumnIds);
    }

    /**
     * 删除数据来源字段信息
     * 
     * @param dataSourceColumnId 数据来源字段主键
     * @return 结果
     */
    @Override
    public int deleteHlsDbDataSourceColumnByDataSourceColumnId(Long dataSourceColumnId)
    {
        return hlsDbDataSourceColumnMapper.deleteHlsDbDataSourceColumnByDataSourceColumnId(dataSourceColumnId);
    }
}
